Telegram Group & Telegram Channel
Screencast from 2024-08-25 19-08-56.webm
10.3 MB
🤖 ChatGPT и Claude AI в API могут запускать функции (functions) или инструменты (tools), которые находятся на сервере клиента. Если LLM считает, что нужно выполнить такую функцию, она передает команду серверу с аргументами для выполнения.

📖 Подробнее можно почитать здесь:
- OpenAI
- Claude

🖥 Вот пример, как функция выглядит для LLM:
{
"name": "get_weather",
"description": "Determine weather in my location",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
]
}
},
"additionalProperties": false,
"required": [
"location",
"unit"
]
}
}


А вот пример того, что видит сервер, когда его просят запустить функцию:

"tool_calls": [
{
"id": "call_fwTWdctuKEO9Ytf",
"name": "get_weather",
"arguments": "{\"location\":\"Moscow\",\"unit\":\"c\"}"
}
]


Сервер запускает функцию и возвращает результат. Причем в любом виде. Далее LLM уже сама придумает что с этим делать.

{
"id": "call_fwTWdctuKEO9Ytf",
"role": "tool",
"content": [
"{\"temp\":\"30\"}"
]
}


А теперь редставьте, что у вас умный дом, и вы говорите: "Включи чайник, я хочу пить". Описываем функции, которые помогут LLM посмотреть что у нас есть в квартире и управлять устройствами:

{
"key": "list_room_devices",
"description": "Lists all smart devices in a specified room.",
"input_schema": {
"type": "object",
"properties": {
"room_name": {
"type": "string",
"description": "The name of the room to query"
}
},
"required": ["room_name"]
}
}


{
"key": "control_device",
"description": "Controls a specific device by performing the specified action with given parameters.",
"input_schema": {
"type": "object",
"properties": {
"deviceId": {
"type": "string",
"description": "The unique identifier of the device to control"
},
"action": {
"type": "string",
"description": "The action to perform on the device (e.g., turnOn, turnOff, setBrightness)"
},
...
},
"required": ["deviceId", "action"]
}
}


Что сделает LLM? Она проанализирует ваш запрос, найдет подходящие функции, получит список устройств на кухне (ведь обычно чайник там), и выполнит нужное действие (включит чайник).

Круто, да? А теперь представьте PHP-фреймворк, который позволит описывать такие процессы (flow) и возьмет на себя сложные задачи, такие как запуск функций, группировку функций по назначению.

P.S. После прочтения, можно пересмотреть видео заново. В этом видео агент для управления умным домом, в котором 4 комнаты и куча устройств. Управление текстом или голосом (с переводом в текст)

#llm #ai #chatgpt #claude #php
Please open Telegram to view this post
VIEW IN TELEGRAM
4🔥153🤮1



tg-me.com/php_fart/103
Create:
Last Update:

🤖 ChatGPT и Claude AI в API могут запускать функции (functions) или инструменты (tools), которые находятся на сервере клиента. Если LLM считает, что нужно выполнить такую функцию, она передает команду серверу с аргументами для выполнения.

📖 Подробнее можно почитать здесь:
- OpenAI
- Claude

🖥 Вот пример, как функция выглядит для LLM:

{
"name": "get_weather",
"description": "Determine weather in my location",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
]
}
},
"additionalProperties": false,
"required": [
"location",
"unit"
]
}
}


А вот пример того, что видит сервер, когда его просят запустить функцию:

"tool_calls": [
{
"id": "call_fwTWdctuKEO9Ytf",
"name": "get_weather",
"arguments": "{\"location\":\"Moscow\",\"unit\":\"c\"}"
}
]


Сервер запускает функцию и возвращает результат. Причем в любом виде. Далее LLM уже сама придумает что с этим делать.

{
"id": "call_fwTWdctuKEO9Ytf",
"role": "tool",
"content": [
"{\"temp\":\"30\"}"
]
}


А теперь редставьте, что у вас умный дом, и вы говорите: "Включи чайник, я хочу пить". Описываем функции, которые помогут LLM посмотреть что у нас есть в квартире и управлять устройствами:

{
"key": "list_room_devices",
"description": "Lists all smart devices in a specified room.",
"input_schema": {
"type": "object",
"properties": {
"room_name": {
"type": "string",
"description": "The name of the room to query"
}
},
"required": ["room_name"]
}
}


{
"key": "control_device",
"description": "Controls a specific device by performing the specified action with given parameters.",
"input_schema": {
"type": "object",
"properties": {
"deviceId": {
"type": "string",
"description": "The unique identifier of the device to control"
},
"action": {
"type": "string",
"description": "The action to perform on the device (e.g., turnOn, turnOff, setBrightness)"
},
...
},
"required": ["deviceId", "action"]
}
}


Что сделает LLM? Она проанализирует ваш запрос, найдет подходящие функции, получит список устройств на кухне (ведь обычно чайник там), и выполнит нужное действие (включит чайник).

Круто, да? А теперь представьте PHP-фреймворк, который позволит описывать такие процессы (flow) и возьмет на себя сложные задачи, такие как запуск функций, группировку функций по назначению.

P.S. После прочтения, можно пересмотреть видео заново. В этом видео агент для управления умным домом, в котором 4 комнаты и куча устройств. Управление текстом или голосом (с переводом в текст)

#llm #ai #chatgpt #claude #php

BY PHP Fart Time


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/php_fart/103

View MORE
Open in Telegram


PHP Fart Time Telegram | DID YOU KNOW?

Date: |

How To Find Channels On Telegram?

There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

PHP Fart Time from hk


Telegram PHP Fart Time
FROM USA